﻿using CMS.Common;
using CMS.Common.Enums;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
namespace CMS.Business
{
    public class KeyValueList : IKeyValueList
    {
        public List<BaseKeyValue> GetKeyValueList()
        {
            return null;
        }

        public List<BaseKeyValue> GetKeyValueListByCatogeryName(CatogeryNameEnum catogery)
        {
            return null;
        }

        public BaseKeyValue GetKeyValueByKeyId(int keyId)
        {
            return null;
        }

        public int GetKeyId(CatogeryNameEnum catogery, string value)
        {
            return 0;
        }

        public List<BaseKeyValue> AddItems(List<BaseKeyValue> list, KeyValueItems includeItem)
        {
            if (list.Any())
            {
                switch (includeItem)
                {
                    case KeyValueItems.None:
                        break;
                    case KeyValueItems.BlankItem:
                        list.Insert(0, new BaseKeyValue { Value = string.Empty });
                        break;
                    case KeyValueItems.AllItem:
                        list.Insert(0, new BaseKeyValue { KeyId = Constants.ITEM_VALUE_ALL, Value = Constants.ITEM_ALL });
                        break;
                    case KeyValueItems.BlankAndAllItem:
                        list.Insert(0, new BaseKeyValue { Value = string.Empty });
                        list.Insert(1, new BaseKeyValue { KeyId = Constants.ITEM_VALUE_ALL, Value = Constants.ITEM_ALL });
                        break;
                    default:
                        break;
                }
            }

            return list;
        }
    }
}
